from com.common.BaseModel import BaseModel, xpath
from com.common import anno
from com.common.anno import TargetUrl, HelpUrl, sched, timeUtil


@HelpUrl(xpath='//a[contains(text(), "下一页")]//@href')
@TargetUrl(xpath=".//div[@class='listleft']//a/@href")
class hsw(BaseModel):
    def __init__(self):
        self.title = xpath('//div[@class="hd"]/h1/text()')
        self.content = xpath('//div[@id="artibody"]//text()')
        self.pubtime = xpath('.//span[@class="article-time"]/text()')
        self.source = xpath('.//span[@class="ly-name"]/text()')


hsw().urls("http://edu.hsw.cn/tjlx/index.shtml").run()
